﻿#region Creditos

/* Autor: Edilberto Sánchez Forero	*/
/* Email: esanchezfo@gmail.com		*/
/* Licencia: Propietario			*/
/* País: Colombia, Bogotá			*/

#endregion

#region Librerias

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESF.General;
using ESF.SSO.ISO8583.RequestHandlers;

#endregion


namespace ESF.SSO.Core.Entities.Exceptions
{
	public static class SSOExceptionCodes
	{
		#region Constantes
		
		public const string USER_INVALIDCREDENTIALS = GenericException.PREFIX_INFORMATIVE_ERROR + "USER_INVALIDCREDENTIALS";
		public const string USER_DISABLED = GenericException.PREFIX_INFORMATIVE_ERROR + "USER_DISABLED";
		public const string TERMINAL_INVALID = GenericException.PREFIX_CRITICAL_ERROR + "TERMINAL_INVALID";
		public const string TERMINAL_DISABLED = GenericException.PREFIX_CRITICAL_ERROR + "TERMINAL_DISABLED";
		
		#endregion
		
		
		#region Funciones
		
		public static string ToSSOISO8583ExceptionCode (string pSSOCode)
		{
			switch (pSSOCode)
			{
				case SSOExceptionCodes.USER_DISABLED:
					return SSOISO8583ExceptionCodes.USER_DISABLED;
				
				case SSOExceptionCodes.USER_INVALIDCREDENTIALS:
					return SSOISO8583ExceptionCodes.USER_INVALIDCREDENTIALS;
					
				case SSOExceptionCodes.TERMINAL_INVALID:
					return SSOISO8583ExceptionCodes.TERMINAL_INVALID;
					
				case SSOExceptionCodes.TERMINAL_DISABLED:
					return SSOISO8583ExceptionCodes.TERMINAL_DISABLED;
				
				default: return "06";
			}
		}
		
		#endregion
	}
}
